import axios from '../utils/axios'

module.exports = async (ctx) => {
  const {
    status,
    data: {
      city
    }
  } = await axios.get(`http://cp-tools.cn/geo/province/${ctx.params.id}`)
  if (status === 200) {
    ctx.body = {
      city
    }
  } else {
    ctx.body = {
      city: []
    }
  }
}
